package com.ruoyi.qiushi.service.mall.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.qiushi.domain.mall.TradeServiceOrder;
import com.ruoyi.qiushi.mapper.mall.TradeServiceOrderMapper;
import com.ruoyi.qiushi.service.mall.ITradeServiceOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 服务商品订单Service业务层处理
 *
 * @author ruoyi
 * @date 2023-12-25
 */
@Service
public class TradeServiceOrderServiceImpl implements ITradeServiceOrderService {
    @Autowired
    private TradeServiceOrderMapper tradeServiceOrderMapper;

    /**
     * 查询服务商品订单
     *
     * @param id 服务商品订单主键
     * @return 服务商品订单
     */
    @Override
    public TradeServiceOrder selectTradeServiceOrderById(Long id) {
        return tradeServiceOrderMapper.selectTradeServiceOrderById(id);
    }

    /**
     * 查询服务商品订单列表
     *
     * @param tradeServiceOrder 服务商品订单
     * @return 服务商品订单
     */
    @Override
    public List<TradeServiceOrder> selectTradeServiceOrderList(TradeServiceOrder tradeServiceOrder) {
        return tradeServiceOrderMapper.selectTradeServiceOrderList(tradeServiceOrder);
    }

    /**
     * 新增服务商品订单
     *
     * @param tradeServiceOrder 服务商品订单
     * @return 结果
     */
    @Override
    public int insertTradeServiceOrder(TradeServiceOrder tradeServiceOrder) {
        tradeServiceOrder.setCreateTime(DateUtils.getNowDate());
        return tradeServiceOrderMapper.insertTradeServiceOrder(tradeServiceOrder);
    }

    /**
     * 修改服务商品订单
     *
     * @param tradeServiceOrder 服务商品订单
     * @return 结果
     */
    @Override
    public int updateTradeServiceOrder(TradeServiceOrder tradeServiceOrder) {
        tradeServiceOrder.setUpdateTime(DateUtils.getNowDate());
        return tradeServiceOrderMapper.updateTradeServiceOrder(tradeServiceOrder);
    }

    /**
     * 删除服务商品订单信息
     *
     * @param id 服务商品订单主键
     * @return 结果
     */
    @Override
    public int deleteTradeServiceOrderById(Long id) {
        return tradeServiceOrderMapper.deleteTradeServiceOrderById(id);
    }
}
